import request from '@/utils/request'
const model = 'catalog'

export function getList(belong) {
  return request({
    url: '/catalog-list/' + belong,
    method: 'get'
  })
}

// export function updateNameById(id, data) {
//   return request({
//     url: '/catalog/' + id + '/name',
//     data,
//     method: 'put'
//   })
// }

export function createItem(name, belong) {
  return request({
    url: '/catalog/' + belong,
    data: { catalog: { name }},
    method: 'post'
  })
}

export function deleteItem(id) {
  return request({
    url: '/catalog/' + id,
    method: 'delete'
  })
}
